From: Jasper St. Pierre Date: Tue, 30 Sep 2014 06:19:28 +0000 (-0600) Subject: search: Factor out a function X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~2064 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=991179835e344d8d9a141e3f9fb9094e4582346c;p=gnome-shell.git search: Factor out a function --- diff --git a/js/ui/search.js b/js/ui/search.js index 8e6b1ddb4..ec00bae10 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -452,6 +452,13 @@ const SearchResults = new Lang.Class({ this._updateResults(provider, results); }, + _clearSearchTimeout: function() { + if (this._searchTimeoutId > 0) { + GLib.source_remove(this._searchTimeoutId); + this._searchTimeoutId = 0; + } + }, + _doSearch: function() { this._startingSearch = false; @@ -470,10 +477,7 @@ const SearchResults = new Lang.Class({ this._updateSearchProgress(); - if (this._searchTimeoutId > 0) { - GLib.source_remove(this._searchTimeoutId); - this._searchTimeoutId = 0; - } + this._clearSearchTimeout(); }, _onSearchTimeout: function() { @@ -489,10 +493,7 @@ const SearchResults = new Lang.Class({ this._cancellable.reset(); if (!terms) { - if (this._searchTimeoutId > 0) { - GLib.source_remove(this._searchTimeoutId); - this._searchTimeoutId = 0; - } + this._clearSearchTimeout(); return; }